<template>
  <div class="TableHeaderTest">
    <el-table
      size="small"
      border
      v-loading="loading"
      :data="tableData"
      style="width: 100%"
    >
      <el-table-column prop="city_name" label="城市"> </el-table-column>
      <el-table-column prop="maxprice" :render-header="renderHeader">
        <template slot-scope="scope">
          <span
            ><span class="skucost-pruice">￥</span
            ><span class="skucost-pruice">{{ scope.row.maxprice }}</span></span
          >
        </template>
      </el-table-column>
      <el-table-column prop="company_name" label="机构名称"> </el-table-column>
      <el-table-column prop="area_name" label="区域"> </el-table-column>
      <el-table-column prop="price" label="价格">
        <template slot-scope="scope">
          <span
            ><span class="skucost-pruice">￥</span
            ><span class="skucost-pruice">{{ scope.row.price }}</span></span
          >
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
export default {
  name: "TableHeaderTest",
  data() {
    return {
      loading: false,
      tableData: [
        {
          city_name: "fafa",
          maxprice: "123",
          company_name: "sfdgsfdgfsd",
          area_name: "hgfhdgf",
          price: "123",
        },
      ],
    };
  },
  methods: {
    //自定义表头
    renderHeader(h) {
      return h("span", {}, [
        // h("span",{class: "headerTest",},"价格"),
        h(
          "el-popover",
          {
            props: {
              placement: "top",
              width: "200",
              trigger: "hover",
              // left:"200",
              content: "城市价格为该城市所有加盟商价格的最高价",
            },
          },
        //   [h("", { slot: "reference", class: "el-icon-question" }, "")]
        [h("span",{slot: "reference",class: "headerTest",},"价格")]
        ),
      ]);
    },
  },
};
</script>
<style>

</style>